import type { DirectiveHook } from 'vue'

const handler: DirectiveHook = (el, binding) => {
  const num = Number(binding.value)
  if (!isNaN(num)) {
    el.textContent = num.toLocaleString()
  }
}

export default handler
